package common;
import java.net.URL;
import java.util.Date;
import java.util.List;

import filter.EpisodeFilter;


public class TvShow {
	
	private String name;
	private URL url;
	private List<Season> seasons;
	private List<URL> feeds;
	private List<EpisodeFilter> filters;
	private Date airDate;
	
	private Season actualSeason;
	private Episode ActualEpisode;
	
	public TvShow(String name, URL url) {
		this.name = name;
		this.url = url;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public URL getUrl() {
		return url;
	}

	public void setUrl(URL url) {
		this.url = url;
	}
	
	public Season getLastSeason(){
		int index = getSeasonsCount() - 1;
		if(index < 0)
			return null;
		else
			return seasons.get(index);
	}
	
	public int getSeasonsCount(){
		if(haveSeasons())
			return seasons.size();
		else
			return 0;
	}
	
	public boolean haveSeasons(){
		return seasons != null && !seasons.isEmpty();
	}

	public Season getActualSeason() {
		return actualSeason;
	}

	public void setActualSeason(Season actualSeason) {
		this.actualSeason = actualSeason;
	}

	public Episode getActualEpisode() {
		return ActualEpisode;
	}

	public void setActualEpisode(Episode actualEpisode) {
		ActualEpisode = actualEpisode;
	}
	
	
}
